#!/usr/bin/env python
# -*- coding: utf-8 -*-

VEHICLE_DATA_DICT = {
    "vin": "vin",
    "motorCurrent": "电机电流",
    "motorSpeed": "电机转速",
    "motorTemperature": "电机温度",
    "motorTorque": "电机转矩",
    "motorVoltage": "电机电压",
    "gear": "档位",
    "remainingBattery": "剩余电量",
    "brakePedal": "制动踏板行程值",
    "fuelConsumptionRate": "燃料消耗率",
    "resistance": "绝缘电阻",
    "singleBatteryMaxTemperature": "单体电池最高温度",
    "singleBatteryMaxVoltage": "单次最大电压",
    "singleBatteryMinTemperature": "单体电池最低温度",
    "singleBatteryMinVoltage": "单体电池最低电压",
    "totalBatteryCurrent": "动力电池充放电电流",
    "totalBatteryVoltage": "动力电池负载端总电压V3",
}


class RedisKey(object):
    vin_fence = "vin:%s:fence"
    fence_info = "fence_info"
    history_move = "history:%s"
    location = "location"
    location_vin = "location:%s"
    mileage = "mileage"
    daily_mileage = "mileage:daily"
    weekly_mileage = "mileage:weekly"
    monthly_mileage = "mileage:monthly"
    total_mileage = "mileage:total"

    @staticmethod
    def get_vin_fence_key(vin):
        return RedisKey.vin_fence % (vin)

    @staticmethod
    def get_fence_info():
        return RedisKey.fence_info

    @staticmethod
    def get_history_move_key(vin):
        return RedisKey.history_move % (vin)

    @staticmethod
    def get_location_vin(vin):
        return RedisKey.location_vin % (vin)

    @staticmethod
    def get_mileage_key():
        return (RedisKey.daily_mileage, RedisKey.weekly_mileage, RedisKey.monthly_mileage, RedisKey.total_mileage)
